<html>

<body>
    <div id="app" key="app" style="widht:100px" class="hi">
    </div>
    <script src="../dist/Vue.js"></script>
    <script>
        var plugin = {
            install: function (Vue, options) {
                // 1. 添加全局方法或 property
                debugger
                Vue.myGlobalMethod = function () {
                }
                // 4. 添加实例方法
                Vue.prototype.$myMethod = function (methodOptions) {
                    // 逻辑...
                    console.log('$myMethod', methodOptions)
                }
            }
        }
        Vue.use(plugin)
        var instance = new Vue({
            el: "#app",
            data: {
                a: 1,
                b: [1, 2, 3, 4, 5, 6]
            }
        })
        console.log(instance.$myMethod)
        console.log(Vue.myGlobalMethod)
    </script>
</body>

</html>